import axios from "axios";
import { getBaseURL } from "./env";
import { ElMessage } from 'element-plus'
import 'element-plus/es/components/message/style/css'
const instance = axios.create({
  baseURL: getBaseURL(),
  timeout: 12000,
  headers: {
    'Content-Type': 'application/json;charset=UTF-8'
  }
})

instance.interceptors.response.use(response => {
  return response.data
}, err => {
  ElMessage.error('网络出错')
})


export default instance